﻿using System.Runtime.InteropServices;
using Microsoft.VisualStudio.Project;
using Microsoft.VisualStudio.Project.Automation;
using Microsoft.WowAddonStudio.Project;
using Microsoft.WowAddonStudio.Project.Automation;

namespace Microsoft.WowAddonStudio.Project
{
	/// <summary>
	/// An object that deals with user interaction via a GUI in the form a hierarchy: a parent node with zero or more child nodes, each of which
	/// can itself be a hierarchy.  
	/// </summary>
    [Guid(GuidStrings.WowLuaFileNode)]
    [ComVisible(true)]
    public class WowLuaFileNode : WowFileNode
    {
		/// <summary>
		/// Initializes a new instance of the <see cref="WowLuaFileNode"/> class.
		/// </summary>
		/// <param name="root">The root.</param>
		/// <param name="e">The e.</param>
        internal WowLuaFileNode(ProjectNode root, ProjectElement e)
            : base(root, e)
        {
        }

		/// <summary>
		/// Gets the index of the image.
		/// </summary>
		/// <value>The index of the image.</value>
        public override int ImageIndex
        {
            get { return (int) ProjectNode.ImageName.ScriptFile; }
        }


        /// <summary>
        /// Returs a Wow FileNode specific object implmenting DTE.ProjectItem
        /// </summary>
        /// <returns></returns>
        public override object GetAutomationObject()
        {
            if (null == automationObject)
            {
                automationObject = new OAWowFileItem(ProjectMgr.GetAutomationObject() as OAProject, this);
            }
            return automationObject;
        }
    }
}